const systemInfo = swan.getSystemInfoSync();

/* global swan */
Component({ // eslint-disable-line
    properties: {
        // 定义了name属性，可以在使用组件时，由外部传入。此变量可以直接在组件模板中使用
        name: {
            type: String,
            theme: ''
        }
    },
    observers: {
        theme() {
            swan.setNavigationBarColor({
                frontColor: '#ffffff',
                backgroundColor: '#3670C2',
                animation: {
                    duration: 500,
                    timingFunc: 'linear'
                }
            });
        }
    },
    data: {
        age: 1,
        statusBarHeight: systemInfo.statusBarHeight
    },
    methods: {
        created() {

        },
        back() {
            swan.navigateBack({
                success: res => {
                    console.log('navigateBack success');
                },
                fail: err => {
                    console.log('navigateBack fail', err);
                }
            });
        }
    }
});